3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
During the rendering of the objects in a view, attribute sets of objects higher in the view hierarchy are inherited by objects below them. For example, if the attribute set of a view specifies a particular diffuse color, then all objects in that view are rendered with that diffuse color, unless some other attribute set overrides the color specified in the view attributes. That is, if some face of some object has an attribute set containing a different diffuse color, the face's diffuse color overrides the diffuse color that otherwise would have been inherited from the view attribute set.
Attribute inheritance always occurs in this order:
In other words, view attributes are always inherited by all groups of objects in the model, unless a group contains overriding attributes. Similarly, any attributes assigned to a geometric object are inherited by all faces of the object, unless a face contains overriding attributes.
This attribute inheritance applies only to the natural attributes contained in any attribute set. If, for example, an attribute set of a view contains a surface normal attribute (which is not a natural attribute for view attribute sets), that attribute is not inherited by any objects lower down in the hierarchy.
If you define a custom attribute, you can specify whether you want that attribute to be inherited along the attribute inheritance path by including an attribute inheritance method in your attribute metahandler. See "Defining Custom Attribute Types" for a sample attribute metahandler that specifies that the temperature attribute is to be inherited. If you do not supply an attribute inheritance method, QuickDraw 3D assumes you want no such inheritance for your custom attribute.
Previous | QD3D Book | Overview | Chapter Contents | Next |